<?php
if ( !isGod() )
{
	die('Không có quyền truy cập vào trang này !');
}
include('vsForm.php');
$mname = (!get_magic_quotes_gpc()) ? addslashes(@$_GET['modname']) : @$_GET['modname'];
if ( empty($mname) )
	$mname = (!get_magic_quotes_gpc()) ? addslashes(@$_POST['txtModName']) : @$_POST['txtModName'];
if ( empty($mname) )
	die('Không đúng tham số !');
$sql = "select * from um_module where modname='$mname'";
$rs = $link->execute($sql);
//############## init control ##########################
$txtModName = new vsControl('txtModName','hidden');
$txtModName->ctrlVal = $mname;
$txtModName->notPost = true;
$txtModName->valRequire = false;

$txtMName = new vsControl('txtMName','textbox','Tên module');
$txtMName->charWidth = 70;
$txtMName->maxChar = 70;
$txtMName->ctrlVal = $mname;
$txtMName->readonly = 'readonly';
$txtMName->ctrlStyle = 'font-family: Tahoma,verdana,arial; font-size: 11px; background-color: #CBDBEF';

$txtMDesc = new vsControl('txtMDesc','textarea','Mô tả');
$txtMDesc->rows = 5;
$txtMDesc->cols = 70;
$txtMDesc->ctrlVal = $rs->fields('moddesc');
$txtMDesc->ctrlStyle = 'font-family: Tahoma,verdana,arial; font-size: 11px; background-color: #FFFFFF';


$btnOK = new vsControl('cmdOK','buttonsubmit','Cập nhật &raquo;');
//################ init form ######################
$frm = new vsForm('frmEditModule','admin.php?mod=Free&act=edit_module&free=yes');
$frm->title = 'Hiệu chỉnh thông tin';
$frm->titleHeight = 25;
$frm->arrItem = array($txtMName,$txtMDesc,$txtModName);
$frm->arrButton = array($btnOK);
//############## params for add action #####################
$frm->gcn = &$link;
$frm->tblName = 'um_module';
$frm->arrFields = array('modname','moddesc');
$frm->arrKeyEdit = array('modname,text'=>$mname);
$frm->actionPrevRender('edit','admin.php?mod=Free&act=module_init&free=yes');
//##########################################
$frm->frmRender();
?>